//
//  InjuryDetailViewController.m
//  MobileOffice
//
//  Created by jjkj on 16/11/1.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "InjuryDetailViewController.h"

@interface InjuryDetailViewController ()
@property (nonatomic,strong) UILabel *yearCountLabel;//年假天数label
//@property (nonatomic,strong) NSMutableArray *otherHolidaysArr;//其他情形假期数组
@end

@implementation InjuryDetailViewController

#pragma mark -工伤假申请
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)getPersonalDaysInfoSuccess{
    _yearCountLabel.text=[NSString stringWithFormat:@"天(可用%@天)",self.personYearDays];
}

#pragma mark -textFieldDelegate
- (BOOL)textFieldShouldBeginEditing:(CustomField *)textField{
    textField.color=COLOR_SKYBLUE;
    //[self addTapGestureRecognizer];
    //将输入的部分滚动到顶部  以免被键盘遮挡
    NSIndexPath* path = [NSIndexPath indexPathForRow:textField.tag-700 inSection:1];
    [self performSelector:@selector(scrollToCell:) withObject:path afterDelay:0];
    return YES;
}

- (BOOL)textFieldShouldEndEditing:(CustomField *)textField{
    textField.color=[UIColor lightGrayColor];
    //[self removeTapGestureRecognizer];
//    //当结束输入时 如果有内容 先将用户输入的信息保存
//    if (textField.text.length>0) {
//        self.holidayCountLabel.text=[NSString stringWithFormat:@"%ld  天",[self.systemHolidaycount integerValue]+[self.textField.text integerValue]];
//    }
    return YES;
}
#pragma mark -限制输入的长度
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    if (string.length == 0) return YES;
    
    NSInteger existedLength = textField.text.length;
    NSInteger selectedLength = range.length;
    NSInteger replaceLength = string.length;
    //第一个不允许输入小数点
    if (textField.text.length==0&&[string isEqualToString:@"."]) {
        return NO;
    }
    //不允许出啊先两个小数点
    if ([textField.text containsString:@"."]&&[string isEqualToString:@"."]) {
        return NO;
    }
    NSInteger count=2;
    //有小数点则限制为4为  整数为2位
    if ([textField.text containsString:@"."]||[string isEqualToString:@"."]) {
        count=4;
    }
    if (existedLength - selectedLength + replaceLength > count) {
        return NO;
    }
    
    return YES;
}

#pragma mark -textViewDelegate

- (void)textViewDidBeginEditing:(UITextView *)textView{
    //将输入的部分滚动到顶部  以免被键盘遮挡
    [self setLabelBorderColorWithLabel:self.reasonTitleLabel color:[UIColor clearColor]];
    NSIndexPath* path = [NSIndexPath indexPathForRow:4 inSection:1];
    [self performSelector:@selector(scrollToCell:) withObject:path afterDelay:0];
}

#pragma mark -初始化数据
- (void)dataInit{
    self.mustSelectArr=[NSMutableArray new];
    self.addWorkPersonArr=[NSMutableArray new];
    _titleArr=@[@"开始时间 :",@"结束时间 :",@"请假天数 :",@"年假冲抵 :"];
    _messageArr=[NSMutableArray arrayWithArray:@[self.beginStr?self.beginStr:@"点击选择",self.endStr?self.endStr:@"点击选择",@"0  天",@""]];
    if (self.beginStr&&self.endStr) {
        [self getVacateDaysOnlyRequest];
    }
}

#pragma mark -页面请假信息请求成功
- (void)getVacateInfoRequestSuccess:(id)responseObject{
    //解析数据
    self.infoModel=[[VacateInfoModel alloc]initWithResponse:responseObject];
    self.beginStr=self.infoModel.vacateBeginTime;
    self.endStr=self.infoModel.vacateEndTime;
    self.taskId=self.infoModel.TaskID;
    NSString *dayStr=[NSString stringWithFormat:@"%@  天",self.infoModel.vacateDays];
    self.reasonTextView.text=self.infoModel.vacateReason;
    self.reasonTextView.textColor=[UIColor blackColor];
    //替换数据
    _messageArr=[NSMutableArray arrayWithArray:@[self.beginStr?self.beginStr:@"点击选择",self.endStr?self.endStr:@"点击选择",dayStr,self.infoModel.yearVacateReplaceDays]];

    //保存委托人
    if (self.infoModel.workEntrustList.count>0) {
        for (int i=0; i<self.infoModel.workEntrustList.count; i++) {
            VacateInfoModel *model=self.infoModel.workEntrustList[i];
            DepartPersonListModel *personModel=[DepartPersonListModel new];
            personModel.personId=model.ids;
            personModel.personName=model.entrustMan;
            personModel.beginStr=model.entrustBeginTime;
            personModel.endStr=model.entrustEndTime;
            personModel.msgContent=model.taskDescribe;
            [self.addWorkPersonArr addObject:personModel];
        }
    }
    [self getTimeControlRequestWithBeginTime:self.beginStr endTime:nil type:@"Begin"];
    [self getTimeControlRequestWithBeginTime:self.beginStr endTime:self.endStr type:@"End"];
    [self getVacateDaysOnlyRequest];
    [_tableView reloadData];
}

#pragma mark - TableViewDelagate

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section==1) {
        return 5;
    }else if (section==2){
        return self.addWorkPersonArr.count+1;
    }
    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.section==0) {
        NSString *cellID=@"DutyBasicTableViewCell";
        DutyBasicTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellID];
        if (!cell) {
            cell=[[DutyBasicTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
            cell.selectionStyle=UITableViewCellSelectionStyleNone;
        }
        cell.myTitleLabel.text=@"申  请  人 :";
        self.userTitleLabel=cell.myTitleLabel;
        cell.messageLabel.text=[NSString stringWithFormat:@"%@ ( %@ )",[LZXHelper getUserName],[LZXHelper getUserDepartName]];
        return cell;
    }else if(indexPath.section==1){
        //请假原因
        if (indexPath.row==4) {
            NSString *cellID=@"ReasonTextTableViewCell";
            ReasonTextTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellID];
            if (!cell) {
                cell=[[ReasonTextTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID title:@" 请填/选请假事由 : " noticeStr:nil];
                cell.selectionStyle=UITableViewCellSelectionStyleNone;
            }
            self.reasonTextView=cell.reasonTextView;
            self.reasonTextView.delegate=self;
            self.reasonTitleLabel=cell.myTitleLabel;
            return cell;
            //年假冲抵
        }else if(indexPath.row==3){
            NSString *cellID=@"DropDetailListTableViewCell";
            DropDetailListTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellID];
            if (!cell) {
                cell=[[DropDetailListTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
                cell.selectionStyle=UITableViewCellSelectionStyleNone;
                //重新对cell的控件进行布局
                cell.myTitleLabel.x=8;
                cell.myTitleLabel.width=80;
                cell.myTitleLabel.textAlignment=NSTextAlignmentCenter;
                cell.textField.x=cell.myTitleLabel.x+cell.myTitleLabel.width+5;
                cell.messageLabel.x=cell.textField.x+cell.textField.width;
                cell.messageLabel.width=IPHONE_WIDTH-(cell.textField.x+cell.textField.width+8);
            }
            cell.myTitleLabel.text=_titleArr[indexPath.row];
            self.yearCountLabel=cell.messageLabel;
            //设置代理
            cell.textField.tag=700+indexPath.row;
            cell.textField.delegate=self;
            self.textField=cell.textField;
            return cell;
        }else{
            NSString *cellID=@"DutyBasicTableViewCell1";
            DutyBasicTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellID];
            if (!cell) {
                cell=[[DutyBasicTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
                cell.selectionStyle=UITableViewCellSelectionStyleNone;
                [cell.signButton addTarget:self action:@selector(signButtonClick:) forControlEvents:UIControlEventTouchUpInside];
            }
            
            //保存疑问按钮
            if (indexPath.row==0) {
                self.beginSignButton=cell.signButton;
                self.beginTitleLabel=cell.myTitleLabel;
            }else if (indexPath.row==1){
                self.endSignButton=cell.signButton;
                self.endTitleLabel=cell.myTitleLabel;
            }
            if (indexPath.row<3) {
                cell.myTitleLabel.text=_titleArr[indexPath.row];
                cell.messageLabel.text=_messageArr[indexPath.row];
            }
            if (indexPath.row==0||indexPath.row==1) {
                cell.arrowImageView.hidden=NO;
                if ([cell.messageLabel.text isEqualToString:@"点击选择"]) {
                    cell.messageLabel.textColor=[UIColor lightGrayColor];
                }else{
                    cell.messageLabel.textColor=[UIColor blackColor];
                }
                
            }else{
                cell.arrowImageView.hidden=YES;
            }
            if (indexPath.row==2) {
                self.holidayCountLabel=cell.messageLabel;
                self.holidaysTitleLabel=cell.myTitleLabel;
                cell.messageLabel.textColor=[UIColor blackColor];
            }
//            if (indexPath.row==3) {
//                self.yearCountLabel=cell.myTitleLabel;
//                self.yearCountLabel.width=IPHONE_WIDTH-16;
//                cell.myTitleLabel.x=14;
//                cell.myTitleLabel.textAlignment=NSTextAlignmentLeft;
//                //                cell.textLabel.text=[NSString stringWithFormat:@"年假可用%@天",self.personYearDays];
//                cell.myTitleLabel.textColor=[UIColor lightGrayColor];
//                //                cell.textLabel.font=FONT_15;
//            }
            return cell;
            
        }
    }else{
        //添加工作委托的按钮
        if (indexPath.row==0) {
            NSString *cellID=@"CenterLabelTableViewCell";
            CenterLabelTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellID];
            if (!cell) {
                cell=[[CenterLabelTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
                cell.selectionStyle=UITableViewCellSelectionStyleNone;
            }
            cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
            cell.myTitle.text=@"点击此处添加工作委托";
            return cell;
             //工作委托人的列表
        }else{
            NSString *cellID=@"AddPersonListTableViewCell";
            AddPersonListTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellID];
            if (!cell) {
                cell=[[AddPersonListTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
                cell.selectionStyle=UITableViewCellSelectionStyleNone;
            }
            DepartPersonListModel *model=self.addWorkPersonArr[indexPath.row-1];
            cell.myTitleLabel.text=model.personName;
            cell.messageLabel.text=[NSString stringWithFormat:@"%@ 至 %@",model.beginStr,model.endStr];
            return cell;
        }
    }
    //    [cell.headImageView setImage:[UIImage imageNamed:_imageArr[indexPath.section][indexPath.row]]];
    //    cell.myTitle.text=_titleArr[indexPath.section][indexPath.row];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [self.reasonTextView resignFirstResponder];
    if (indexPath.section==1) {
        if (indexPath.row==0||indexPath.row==1){
            NSString *dateStr=nil;
            if (indexPath.row==0) {
                if (self.beginStr) {
                    dateStr=self.beginStr;
                }else if (self.endStr){
                    dateStr=self.endStr;
                }
            }
            if (indexPath.row==1) {
                if (self.endStr) {
                    dateStr=self.endStr;
                }else if (self.beginStr){
                    dateStr=self.beginStr;
                }
            }
            //创建日期选择view
            DatePickerView *datePickerView=[[DatePickerView alloc]initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT)nowDateStr:dateStr];
            __weak NSMutableArray *myMessageArr=_messageArr;
            __weak UITableView *myTableView=_tableView;
            __weak DutyParentsViewController *mySelf=self;
            datePickerView.sureBlock=^(NSString *timeStr){
                if (indexPath.row==0) {
                    //如果是选择开始时间
                    //先判断有没有结束时间,如果有要进行比对
                    if (mySelf.endStr) {
                        if (![mySelf compareOneTime:timeStr withAnotherTime:mySelf.endStr]) {
                            [LZXHelper postMessageWithText:@"请假结束时间应该在请假开始时间之后!" View:mySelf.view];
                        }
                        [mySelf getVacateDaysOnlyRequest];
                    }
                    if (mySelf.dutyType==ApplyHoliday) {
                        //如果是请假
                        if ([mySelf compareTime:timeStr]) {
                            //比现在的时间早
                            [LZXHelper postAlertViewControllerWithTitle:@"您选择的请假开始时间早于今天,要补假吗?" message:nil cancelButtonTitle:@"选错时间了" otherButtonTitle:@"去补假" cancelEvent:^{
                                
                            } otherEvent:^{
                                mySelf.dutyType=1;
                                
                                [mySelf setNavigationTitle:[mySelf.navaTitle stringByAppendingString:@"补假申请"]];
                                
                            } viewController:mySelf];
                        }else{
                            //比现在的时间晚
                            mySelf.beginStr=[timeStr copy];
                            [mySelf setLabelBorderColorWithLabel:mySelf.beginTitleLabel color:[UIColor clearColor]];
                            //替换数据源数组 并刷新
                            [myMessageArr replaceObjectAtIndex:indexPath.row withObject:timeStr];
                            [myTableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
                            [mySelf getTimeControlRequestWithBeginTime:[timeStr copy]endTime:nil type:@"Begin"];
                        }
                        
                    }else{
                        //如果是补假
                        if ([mySelf compareTime:timeStr]){
                            //比现在的时间早
                            mySelf.beginStr=[timeStr copy];
                            [mySelf setLabelBorderColorWithLabel:mySelf.beginTitleLabel color:[UIColor clearColor]];
                            //替换数据源数组 并刷新
                            [myMessageArr replaceObjectAtIndex:indexPath.row withObject:timeStr];
                            [myTableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
                            [mySelf getTimeControlRequestWithBeginTime:[timeStr copy]endTime:nil type:@"Begin"];
                        }else{
                            //比现在的时间晚
                            [LZXHelper postAlertViewControllerWithTitle:@"您选择的请假开始时间晚于今天,要请假吗?" message:nil cancelButtonTitle:@"选错时间了" otherButtonTitle:@"去请假" cancelEvent:^{
                                
                            } otherEvent:^{
                                mySelf.dutyType=0;
                                [mySelf setNavigationTitle:[mySelf.navaTitle stringByAppendingString:@"申请"]];
                            } viewController:mySelf];
                        }
                    }
                    
                }else{
                    //点击结束时间
                    mySelf.endStr=[timeStr copy];
                    [mySelf setLabelBorderColorWithLabel:mySelf.endTitleLabel color:[UIColor clearColor]];
                    //替换数据源数组 并刷新
                    [myMessageArr replaceObjectAtIndex:indexPath.row withObject:timeStr];
                    [myTableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
                    [mySelf getVacateDaysOnlyRequest];
                    [mySelf getTimeControlRequestWithBeginTime:mySelf.beginStr endTime:[timeStr copy] type:@"End"];
                }
            };
            [[[UIApplication sharedApplication].delegate window] addSubview:datePickerView];
        }
    }else if (indexPath.section==2&&indexPath.row==0){
        if (!self.beginStr) {
            [LZXHelper postMessageWithText:@"请假开始时间不能为空!" View:self.view];
            return;
        }
        if (!self.endStr) {
            [LZXHelper postMessageWithText:@"请假结束时间不能为空!" View:self.view];
            return;
        }
        //跳转到增加委托人页面
        AddWorkPersonViewController *person=[AddWorkPersonViewController new];
        person.dutyType=self.dutyType;
        person.beginStr=self.beginStr;
        person.endStr=self.endStr;
        __weak UITableView *myTableView=_tableView;
        //增加委托人回调函数 并刷新列表
        person.myBlock=^(DepartPersonListModel *model){
            [self.addWorkPersonArr addObject:model];
            [myTableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section]  withRowAnimation:UITableViewRowAnimationFade];
        };
        [self.navigationController pushViewController:person animated:YES];
    }else{
        
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    //如果是添加工作委托
    if (indexPath.section==2) {
        if (indexPath.row==0) {
            return 50;
        }else{
            return 64;
        }
        //请假内容
    }else if (indexPath.section==1){
        if (indexPath.row==4) {
            return 100;
        }else{
            return 50;
        }
    }
    return 50;
}

#pragma mark -获取提交时的提示文字

- (void)submitApplyRequestWithState:(NSString *)state{
    [self.view endEditing:YES];
    if (self.textField.text.length>0) {
        self.yearVacateReplaceDays=[self.textField.text copy];
    }
    //如果有必选项没填则需提示和标记出来
    if (!self.beginStr) {
        [LZXHelper postMessageWithText:@"请假开始时间不能为空!" View:self.view];
        [self setLabelBorderColorWithLabel:self.beginTitleLabel color:[UIColor redColor]];
        return;
    }else{
        [self setLabelBorderColorWithLabel:self.beginTitleLabel color:[UIColor clearColor]];
    }
    
    if ([_beginTimeModel.isCanCommit isEqualToString:@"0"]||_beginTimeModel==nil) {
        [LZXHelper postMessageWithText:_beginTimeModel.myMessage View:self.view];
        [self setLabelBorderColorWithLabel:self.beginTitleLabel color:[UIColor redColor]];
        return;
    }else{
        [self setLabelBorderColorWithLabel:self.beginTitleLabel color:[UIColor clearColor]];
    }
    
    if (!self.endStr) {
        [LZXHelper postMessageWithText:@"请假结束时间不能为空!" View:self.view];
        [self setLabelBorderColorWithLabel:self.endTitleLabel color:[UIColor redColor]];
        return;
    }else{
        [self setLabelBorderColorWithLabel:self.endTitleLabel color:[UIColor clearColor]];
    }
    
    //    if (![self compareOneTime:self.beginStr withAnotherTime:self.endStr]) {
    //        [LZXHelper postMessageWithText:@"请假结束时间应该在请假开始时间之后!" View:self.view];
    //        //[self setLabelBorderColorWithLabel:_beginTitleLabel with:[UIColor redColor]];
    //        return;
    //    }
    //    else{
    //        [self setLabelBorderColorWithLabel:_beginTitleLabel with:[UIColor redColor]];
    //    }

    if ([self.holidayCount isEqualToString:@"0"]||[self.holidayCount isEqualToString:@"0.0"]||[self.holidayCount isEqualToString:@"0.00"]||self.holidayCount==nil) {
         [LZXHelper postMessageWithText:[NSString stringWithFormat:@"%@时长不能为0!",self.navaTitle] View:self.view];
        [self setLabelBorderColorWithLabel:self.holidaysTitleLabel color:[UIColor redColor]];
        return;
    }else{
        [self setLabelBorderColorWithLabel:self.holidaysTitleLabel color:[UIColor clearColor]];
    }
    
    if ([self.endTimeModel.isCanCommit isEqualToString:@"0"]||self.endTimeModel==nil) {
        [LZXHelper postMessageWithText:self.endTimeModel.myMessage View:self.view];
        [self setLabelBorderColorWithLabel:self.endTitleLabel color:[UIColor redColor]];
        return;
    }else{
        [self setLabelBorderColorWithLabel:self.endTitleLabel color:[UIColor clearColor]];
    }
    
    if (self.yearVacateReplaceDays.floatValue >self.personYearDays.floatValue) {
        [LZXHelper postMessageWithText:@"冲抵天数不能大于年假天数!" View:self.view];
        return;
    }

    if (self.reasonTextView.text.length==0) {
        [LZXHelper postMessageWithText:@"请假事由不能为空!" View:self.view];
        [self setLabelBorderColorWithLabel:self.reasonTitleLabel color:[UIColor redColor]];
        return;
    }else{
        [self setLabelBorderColorWithLabel:self.reasonTitleLabel color:[UIColor clearColor]];
    }
    NSDictionary *dict=@{
                         @"BusinessCode":self.businessCode?self.businessCode:@"",
                         @"BeginTime":self.beginStr?self.beginStr:@"",
                         @"EndTime":self.endStr?self.endStr:@"",
                         @"LeaveTypePK":self.keywordId?self.keywordId:@"",
                         @"vacateBillId":@""
                         };
    
    //   字典转json
    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil];
    NSString* str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
    //拼接soap字符串
    NSString* soap = [NSString stringWithFormat:@"<sessionId>%@</sessionId>\n<content>%@</content>",[LZXHelper getSessionID],str];
    //[LZXHelper postLoadViewWithText:HUD_PLEASEWAIT View:self.view];
    // __weak AddressBookViewController *mySelf=self;
    [HttpRequest SOAPData:[LZXHelper getServerURL] SoapMthod:IsOverLaped soapBody:soap success:^(id responseObject) {
        //[LZXHelper hideLoadViewWithView:self.view];
        
        //解析数据
        __weak InjuryDetailViewController *mySelf=self;
        BasicModel *model=[[BasicModel alloc]initWithResponse:responseObject];
        if ([model.code isEqualToString:@"200"]) {
            NSDictionary *dict=responseObject[@"retContent"];
            if ([dict[@"IsOverLap"] isEqualToString:@"0"]) {
                [LZXHelper postAlertViewControllerWithTitle:dict[@"strDesc"] message:nil cancelButtonTitle:@"取消" otherButtonTitle:@"确定" cancelEvent:^{
                    
                } otherEvent:^{
                    [mySelf postSickVacateInfoRequestWith:state];
                } viewController:mySelf];
            }else{
                DateConflictView *date=[[DateConflictView alloc]initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT) message:dict[@"strDesc"]];
                //确定回调函数
                date.promptTimeBlock=^(NSInteger selectNum){
                    mySelf.optionType=[NSString stringWithFormat:@"%ld",selectNum-1];
                    [mySelf postSickVacateInfoRequestWith:state];
                };
                //取消回调函数
                date.promptTimeCancelBlock=^(){
                    //_promptTimeView=nil;
                };
                [[[UIApplication sharedApplication].delegate window] addSubview:date];
            }
        }else if([model.code isEqualToString:@"220"]){
            [LZXHelper postMessageWithText:model.msg View:self.view];
        }
    } failure:^(NSError *error) {
        //[LZXHelper hideLoadViewWithView:self.view];
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
